Structuring Creativity: Poetry Generation with ChatGPT

Paweł Sierszeń
8 min readDec 4, 2022

Are you a poet who’s looking to try out the latest AI tools to generate some new ideas? Or maybe you’re just curious about what AI can do when it comes to creativity? Either way, you’re in the right place. In this blog post, I’ll be exploring how to use ChatGPT to generate poetry in a structured way. I’ll also share an example of poetry generated using this approach, so you can see for yourself how it works.

One aspect of using AI tools like ChatGPT for creative tasks is the question of authorship. Some may argue that the AI is the true author of the generated content, while others may see the human user as the author for providing the input and structuring the process. This debate has been discussed in particular in relation to AI-generated artwork and computer code. However, the ability of AI to not only generate but also curate content adds an additional layer to this discussion. As AI algorithms continue to improve, it will be interesting to see how the roles of human creators and AI co-creators evolve across all forms of creative expression.

Controlling the messy creativity of language models

Guiding an AI model with follow-up questions is actually a technique that can be applied to any creative task. Poetry just happens to be a great example because it often involves exploring complex themes and emotions, and requires a certain level of creativity and imagination. While the resulting poems may not always be well-crafted, they can provide insight into the capabilities of AI in the realm of creative expression.

Simply giving a prompt to GPT-3/GPT-3.5 and expecting a great result can be a bit hit or miss. Large language models like ChatGPT are great at generating text, but they often need a little guidance to produce something creative and thought-provoking. That’s where a structured approach comes in.

By using follow-up questions to guide the model, we can help it consider different aspects of the prompt and generate a more nuanced, well-rounded response. For example, if the initial prompt is ‘write a poem about love’, we could ask follow-up questions like ‘What kind of love are you exploring in the poem?’, ‘What emotions does love evoke for the speaker?’, or ‘How does the speaker’s perspective on love change throughout the poem?’. These questions can help ChatGPT generate a more complex, interesting poem that goes beyond the surface level of the prompt.

In addition to improving the quality of the result, such a process is more engaging and interactive. Instead of trying to figure out that perfect prompt, we can actively guide ChatGPT and see how it responds to our questions and feedback.

“Engineering” a poem

To illustrate how this structured approach can work in practice, let’s take a look at the process of writing a poem. In this case, we might start by asking ChatGPT to provide a possible metaphor for the theme of the poem. Then, we might ask it to suggest a rhythmic structure that would suit the theme of the poem. At each step in the process, ChatGPT makes decisions which indirectly shape the end result.

Example (prompts are in bold)

[Me] Suggest a non-trivial metaphor to use in a poem entitled ‘Is it for me?’. Describe the literal meaning of the poem, the story it tells, the mood it conveys, and develop the multi-level structure of its metaphorical meanings.

[ChatGPT] A metaphor for the poem “Is it for me?” could be a flower blooming in a garden. The literal meaning of the poem could be a person wondering if something, such as love or opportunity, is meant for them. The story it tells could be the internal struggle of self-doubt and the desire for acceptance. The mood it conveys could be one of uncertainty and longing.

On a deeper level, the metaphor of the flower blooming in a garden could represent the person’s growth and potential. The garden could symbolize the vastness of life and the many possibilities available. The uncertainty of whether or not the flower will bloom could symbolize the uncertainty of whether or not the person will fulfill their potential and find what they are looking for. The longing for the flower to bloom could represent the person’s desire for success and happiness.

Overall, the metaphor of the flower blooming in a garden adds a layer of depth and richness to the poem, allowing the reader to connect with the emotions and experiences of the narrator.

[Me] Describe the content and structure of the poem in more detail.

[ChatGPT] The poem “Is it for me?” could be structured as a series of quatrains, with each stanza exploring a different aspect of the narrator’s internal struggle. The first stanza could introduce the metaphor of the flower blooming in a garden, setting the scene and establishing the central conflict of the poem. The second stanza could delve into the narrator’s doubts and fears, using sensory imagery to convey their emotional state. The third stanza could focus on the narrator’s longing for something more, and their desire to bloom like the flower in the garden. The final stanza could offer a resolution, either in the form of the flower finally blooming, or the narrator finding the strength to overcome their doubts and pursue their dreams.

Throughout the poem, the metaphor of the flower blooming in a garden would provide a unifying thread, connecting the different elements of the poem and adding depth and meaning to the narrator’s experiences. The use of sensory imagery and emotional language would help to convey the mood of uncertainty and longing, drawing the reader into the narrator’s internal world. By combining these elements, the poem would create a multi-layered narrative that explores the universal theme of self-doubt and the pursuit of happiness.

[Me] What metric structure can it have? What kind of rhymes would be best And how could the sounds relate to the meaning?

[ChatGPT] The poem “Is it for me?” could have a metric structure, such as iambic pentameter, with each line consisting of ten syllables and a regular pattern of stressed and unstressed syllables. This structure would create a sense of flow and rhythmic balance, allowing the poem to unfold naturally and drawing the reader in.

In terms of rhyme, the poem could use end rhymes, with each stanza ending with words that rhyme with each other. This could create a sense of unity and cohesion, and add to the overall musicality of the poem. For example, the first stanza could end with words like “me,” “see,” and “be,” creating a soft, mellow sound that reflects the calmness of the garden. The second stanza could end with words like “fear,” “tear,” and “near,” creating a sharper, more anxious sound that reflects the narrator’s doubts and fears. The third stanza could end with words like “more,” “before,” and “door,” creating a sense of longing and anticipation.

Overall, the use of metric structure and rhyme would add to the musicality and cohesiveness of the poem, enhancing its emotional impact and helping to convey its meaning. By carefully choosing rhymes that reflect the mood and themes of the poem, the poet could create a rich and multi-layered work that engages the reader on multiple levels.

[Me] How does it relate to the style of Seamus Heaney?

[ChatGPT] It is difficult to say how the poem “Is it for me?” would relate to the style of Seamus Heaney without knowing more about the specific details of the poem. However, in general, Heaney’s poetry often explores themes of nature, rural life, and the relationship between the past and the present. He often uses sensory imagery and metaphors to convey complex emotions and ideas, and his poems often have a strong musical quality, with careful attention to meter, rhyme, and alliteration.

If the poem “Is it for me?” incorporates these elements, it could be said to be in a similar style to Heaney’s work. For example, if the poem uses nature imagery and metaphors to explore the narrator’s inner experiences, and if it uses metric and rhyme schemes to create a musical quality, it could be said to be in a similar vein to Heaney’s poetry. However, ultimately, the relationship between the poem and Heaney’s style would depend on the specific details and choices made by the poet.

[Me] Write the poem using the metaphors and structure mentioned above, ideally in the style of Seamus Heaney.

[ChatGPT]
In a garden green and fair,
A flower blooms, a sight so rare.
But is it meant for me, I fear?
Will I, like it, bloom this year?

I feel the doubts that haunt my mind,
The fears that make my heart unkind.
I see the world, so vast and wide,
And wonder if I’ll find my side.

I long to be a flower bright,
To spread my petals, pure and white.
I yearn to grow and reach my prime,
And bask in life’s warm, golden shine.

But still I fear, and still I doubt,
Afraid to reach, to stretch, to sprout.
But I will try, with all my might,
To bloom and grow, and take flight.

For I am more than just a flower,
A bloom that withers in an hour.
I am a soul, with strength and grace,
And I will find my rightful place.

The generated poem may not be perfect, but writing poetry is a particularly challenging task, also for humans. It requires a deep understanding of language, as well as the ability to convey complex emotions and ideas. As AI language models like ChatGPT continue to be developed and improved, we can expect to see more sophisticated and nuanced poetry generation. It is also worth noting that while ChatGPT is a general-purpose language model, someone may choose to build a system specifically optimized for poetry generation, which could potentially yield better results.

Summary

In this blog post, I’ve explored how to use ChatGPT to generate poetry in a structured way. This technique can actually be applied to any creative task, and poetry is just a great example of how it can help generate more complex, interesting responses. I’ve seen how this approach can improve the quality of the generated content, and make the process more engaging and interactive. I encourage you to try it out for yourself and see what amazing creations you can come up with. Happy writing!

Disclaimer
Most of this blog post was written by AI. But don’t worry, I supervised the whole process and made sure it was up to snuff. And hey, if you can’t trust AI to write a blog post, what can you trust it to do?

Illustrations
Robotic poet — generated by Midjourney,
Guiding AI by hand — generated by DALL-E,
Blooming flower — generated by StarryAI.

--

--

Paweł Sierszeń

Software Engineer. Also: wine, food science, cheesemaking, investing, learning languages.